<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <div id="t">test</div>
<script>
var obj = document.getElementById('t');
obj.attachEvent('onclick',function(){
  console.log('one');
});
obj.attachEvent('onclick',function(){
  console.log('two');
});
</script>

<div id="t">test</div>
<script>
var obj = document.getElementById('t');
obj.addEventListener('click',function(){
  console.log('one');
});
obj.addEventListener('click',function(){
  console.log('two');
});
</script>
</head>

<body>
<div id="t">test</div>
<script>
var obj = document.getElementById('t');
obj.attachEvent('onclick',function(){
  console.log('one');
});
obj.attachEvent('onclick',function(){
  console.log('two');
});
</script>

<div id="t">test</div>
<script>
var obj = document.getElementById('t');
obj.addEventListener('click',function(){
  console.log('one');
});
obj.addEventListener('click',function(){
  console.log('two');
});
</script>
</body>
</html>